

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title><g:message code="menuButton.edit" default="Edit"/> Country</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}"><g:message code="menuButton.home" default="Home"/></a></span>
            <span class="menuButton"><g:link class="list" action="list">Country <g:message code="menuButton.list" default="List"/></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="menuButton.new" default="New"/> Country</g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="menuButton.edit" default="Edit"/> Country</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${countryInstance}">
            <div class="errors">
                <g:renderErrors bean="${countryInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <input type="hidden" name="id" value="${countryInstance?.id}" />
                <input type="hidden" name="version" value="${countryInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="leagues">Leagues:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:countryInstance,field:'leagues','errors')}">
                                    
<ul>
<g:each var="l" in="${countryInstance?.leagues?}">
    <li><g:link controller="league" action="show" id="${l.id}">${l?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="league" params="['country.id':countryInstance?.id]" action="create">Add League</g:link>

                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name">Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:countryInstance,field:'name','errors')}">
                                    <input type="text" id="name" name="name" value="${fieldValue(bean:countryInstance,field:'name')}"/>
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" value="${message(code:'menuButton.update', default:'Update')}" action="update" /></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('${message(code:'menuButton.delete.confirm', default:'Are you sure?')}');" value="Delete"/></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
